/*
 * Copyright (c) 1989 - 1999 Microsoft Corporation
 */

#include "precomp.h"
#pragma hdrstop

#include "mrxglobs.h"

#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, HwFsLocks)
#pragma alloc_text(PAGE, HwFsCompleteBufferingStateChangeRequest)
#pragma alloc_text(PAGE, HwFsFlush)
#endif

NTSTATUS
HwFsLocks(
    IN PRX_CONTEXT RxContext)
{
    PHWFS_DEVICE_EXTENSION   pDevExt = HWFS_GET_DEVICE_EXTENSION(RxContext);

    __notnull PMRX_FOBX pFobx = RxContext->pFobx;
    __notnull PMRX_SRV_OPEN pSrvOpen = pFobx->pSrvOpen;
    __notnull PHWFS_SRVOPEN_EXTENSION pSrvOpenExt = pSrvOpen->Context;

    PLOWIO_CONTEXT pLowIo = &RxContext->LowIoContext;

    HWFS_DBG_PRINT(DBG_INFO, DBG_ANY,
        ("HwFsLocks: File %s, Op 0x%x, Flags 0x%08x, Len 0x%I64x, Offset 0x%I64x, Key 0x%x\n",
            pSrvOpenExt->HwfsFile.Utf8FileName,
            pLowIo->Operation,
            pLowIo->ParamsFor.Locks.Flags,
            pLowIo->ParamsFor.Locks.Length,
            pLowIo->ParamsFor.Locks.ByteOffset,
            pLowIo->ParamsFor.Locks.Key));

    //
    // Several functionalities doesn't work if Lock fails:
    // Unable to install from MSI, etc.
    //

#pragma message("ToDo: Call Fuse to lock/unlock the file")

    return STATUS_SUCCESS;
}

NTSTATUS
HwFsCompleteBufferingStateChangeRequest(
    IN OUT PRX_CONTEXT         RxContext,
    IN OUT PMRX_SRV_OPEN       SrvOpen,
    IN     PVOID               pContext)
{
    HWFS_DBG_PRINT(DBG_ERR, DBG_ANY, ("HwFsCompleteBufferingStateChangeRequest\n"));
    return STATUS_NOT_IMPLEMENTED;
}

NTSTATUS
HwFsFlush(
      IN PRX_CONTEXT RxContext)
{
    HWFS_DBG_PRINT(DBG_ERR, DBG_ANY, ("HwFsFlush\n"));
    return STATUS_SUCCESS;
}
